package com.java.tutorials.jdk7.fileoperation;

import com.java.tutorials.Constants;

import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * Created by xuzhike on 2016/1/25.
 * http://www.java2s.com/Code/Java/JDK-7/CopyDirectory.htm
 */
public class CopyDirectory {
    public static void main(String[] args) throws Exception {
        Path originalDirectory = FileSystems.getDefault().getPath(Constants.ANOTHER_TEST_PATH);
        Path newDirectory = FileSystems.getDefault().getPath(Constants.TEST_PATH+"tmp");

        Files.copy(originalDirectory, newDirectory);//里面的文件不复制
        System.out.println("Directory copied successfully!");

    }
}
